package com.jzo2o.customer.controller.worker;


import com.jzo2o.common.utils.UserContext;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.ICertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 实名认证接口
 *
 * @author 12428
 */
@RestController("CertificationController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 实名信息认证习惯接口")
public class CertificationController {
    @Resource
    ICertificationService certificationService;

    @PostMapping
    @ApiOperation("服务人员实名认证")
    public void audit(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationAuditAddReqDTO.setServeProviderId(UserContext.currentUserId());
        certificationService.audit(workerCertificationAuditAddReqDTO);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新驳回原因")
    public String rejectReason() {
        return certificationService.rejectReason();
    }
}
